from PIL import Image
import pytesseract

Image = Image.open('test.jpg')
# Image = Image.open('img.png')
# print(Image)
config = "--psm 7 --oem 3 -c tessedit_char_whitelist=0123456789"
text = pytesseract.image_to_string(Image, config=config)
# text = pytesseract.image_to_string(Image, lang='chi_sim')
print(text)
file = open("test.txt", "w")
file.writelines(text)
file.close()
